package fh.app4stud.mensa;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;

import java.util.ArrayList;

/**
 * Created by IntelliJ IDEA.
 * User: ivan plese
 * Date: 03.04.11
 * Time: 19:33
 * Version 1.0
 * To change this template use File | Settings | File Templates.
 */
public class LocationMenuList extends Activity {

    Button more;
    ArrayList<String> menuItems;
    ArrayAdapter aa;

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);


        setContentView(R.layout.today_menu_list);
        more = (Button) findViewById(R.id.location_list_menu_button_more);

        ListView menuListView = (ListView) findViewById(R.id.today_menu_list_view);

        menuItems = new ArrayList<String>();
        //add dummy items, later to replace with items from web service
        String first = "Healthy menu";
        String second = "Expensive menu";
        String third = "Cheap menu";
        String fourth = "Healthy menu";

        menuItems.add(first);
        menuItems.add(second);
        menuItems.add(third);
        menuItems.add(fourth);

        int resID = android.R.layout.simple_list_item_1;
        aa = new ArrayAdapter(this, resID, menuItems);

        menuListView.setAdapter(aa);
        hookUpButtons();
    }

    private void hookUpButtons() {
        more.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                Intent getData = new Intent(LocationMenuList.this, LocationList.class);
                startActivity(getData);
            }
        });
    }
}
